package com.easondongh.spring.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author donghao
 * @date 2022/1/10 21:11
 */
@Component
public class OrderService {

    @Value("${123}")
    private String test;

    @Autowired
    private UserService userService;

    public OrderService() {
        System.out.println("OrderService()");
    }

    public void userServiceTest() {
        userService.test();
    }

//    @Autowired(required = false)
//    public OrderService(UserService userService) {
//        System.out.println("OrderService(UserService)");
//    }
//
//    @Autowired(required = false)
//    public OrderService(UserService userService, UserService userService1) {
//        System.out.println("OrderService(UserService, UserService)");
//    }
//
//    @Autowired(required = false)
//    public OrderService(UserService userService, ICommon common) {
//        System.out.println("OrderService(UserService, ICommon)");
//    }

    public void test() {
        System.out.println("OrderService.test");
    }

    @Autowired
    public void testAutowired(@Autowired(required = false) String hahaha, UserService userService) {
        System.out.println("OrderService.testAutowired()");
        System.out.println(userService);
        System.out.println(hahaha);
    }
}
